package com.ruoyi.food.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.food.domain.Food;
import com.ruoyi.food.service.FoodService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


/**
 * 食物控制器
 *
 * @author Administrator
 * @date 2023/03/14
 */
@RestController
@RequestMapping("/food")
@RequiredArgsConstructor
public class FoodController extends BaseController {

    private final FoodService foodService;

    /**
     * 列表菜品
     *
     * @return {@link R}<{@link Map}<{@link String}, {@link List}<{@link Food}>>>
     */
    @GetMapping
    public R<Map<String, List<Food>>> listFood() {
        return R.ok(foodService.listFood());
    }

}
